Test Series - java script

Test Number 25/92

Q: The word “document” mainly refers to ______________
A. Dynamic Information
B. Static Information
C. Both Dynamic and Static Information
D. Temporary information
Solution: Some pages present static information and can be called documents. The document is a keyword which is used in selecting any particular element in the document.
Q: Which object is the main entry point to all client-side JavaScript features and APIs?
A. Standard
B. Location
C. Window
D. Position
Solution: The Window object is the main entry point to all client-side JavaScript features and APIs. It represents a web browser window or frame, and you can refer to it with the identifier window.
Q: Which identifier is used to represent a web browser window or frame?
A. frames
B. window
C. location
D. frame
Solution: The window object represents a web browser window or frame, and you can refer to it with the identifier window. Global variables are properties of the window object and Global functions are methods of the window object.
Q: Which property in the Window object is used to refer to a Location object?
A. position
B. area
C. window
D. location
Solution: The Window object defines properties like location, which refers to a Location object that specifies the URL currently displayed in the window and allows a script to load a new URL into the window. The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page.
Q: Which Window object method is used to display a message in a dialog box?
A. alert()
B. prompt()
C. message()
D. console.log
Solution: The Window object defines methods like alert(), which displays a message in a dialog box. A prompt message can be displayed on the screen using alert().
Q: The setTimeout() method is used to _______________
A. Make the event sleep
B. Register a function to be invoked after a certain time
C. Invoke an event after a certain time
D. Time for iteration
Solution: The setTimeout(), which registers a function to be invoked after a specified amount of time. The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds.
Q: Which of the following is a global object?
A. Register
B. Location
C. Window
D. Position
Solution: In client-side JavaScript, the Window object is also the global object. This means that the Window object is at the top of the scope chain and that its properties and methods are effectively global variables and global functions.
Q: When will the window property come into play?
A. Representation convenience
B. Use as an extension of other objects
C. Use objects in the Window object
D. Refer to window object itself
Solution: The Window object has a property named window that always refers to itself. You can use this property if you need to refer to the window object itself.
Q: Which is the property that represents the content displayed in the window?
A. document
B. content
C. window
D. frame
Solution: One of the most important properties of the Window object is document: it refers to a Document object that represents the content displayed in the window.
Q: How to pick a document element based on the value of its id attribute?
A. getElementsbyId()
B. getElementbyId()
C. both getElementsbyId() and getElementbyId()
D. getElement
Solution: The Document object has important methods such as getElementById(), which returns a single document element (representing an open/close pair of HTML tags and all of the content between them) based on the value of its id attribute. Using this property different operation can be performed on the selected element.

You Have Score    /10